#!/bin/ksh

HOSTS="google.com yahoo.com nonexistent.domain"

for tgt_host in $HOSTS
do
  ping -q -c1 -S 1 $tgt_host > /dev/null 2>&1
  if [ $? -ne 0 ]; then
    print "$tgt_host,dwn"
  else
    print "$tgt_host,up"
  fi
done

exit
